<!--
 * @Author         : yanyongyu
 * @Date           : 2022-09-23 14:11:18
 * @LastEditors    : yanyongyu
 * @LastEditTime   : 2022-10-17 12:05:28
 * @Description    : None
 * @GitHub         : https://github.com/yanyongyu
-->

{% from "icons/repo-push.html.jinja" import octicon_repo_push %}

{% macro head_ref_force_pushed(event, ns) %}
{% set pull_request = get_pull_request(ns.issue) %}
<div class="TimelineItem">
  <div class="TimelineItem-badge">
    {{ octicon_repo_push() }}
  </div>
  <div class="TimelineItem-body">
    <a>
      <img class="avatar avatar-user" height="20" width="20" src="{{ event.actor.avatar_url }}" />
    </a>
    <a class="author Link--primary text-bold">{{ event.actor.login|escape }}</a>
    force-pushed the
    <span class="branch-name css-truncate color-fg-muted">
      <a class="no-underline">
        {{ pull_request.head.ref|escape }}
      </a>
    </span>
    branch
    {% if event.commit_id %}
    to
    <a class="Link--primary text-bold no-underline">
      <code>{{ event.commit_id[:7] }}</code>
    </a>
    {% endif %}
    <a class="Link--secondary">{{ event.created_at|relative_time }}</a>
  </div>
</div>
{% endmacro %}
